home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / wnos5src.zip / NNTP.H < prev    next >
Text File  |  1993-08-09  |  5KB  |  174 lines

  1. #ifndef _NNTP_H
  2. #define _NNTP_H
  3.  
  4. #ifndef _GLOBAL_H
  5. #include "global.h"
  6. #endif
  7.  
  8. #ifndef _DOS_H
  9. #include <dos.h>
  10. #endif
  11.  
  12. #ifndef _TIME_H
  13. #include <time.h>
  14. #endif
  15.  
  16. #ifndef _TIMER_H
  17. #include "timer.h"
  18. #endif
  19.  
  20. #ifndef _SMTP_H            /* needed for header strings */
  21. #include "smtp.h"
  22. #endif
  23.  
  24. /****************************************************************/
  25. /*                                                              */
  26. /*      Compiler option for enhanced NNTP functions (DG1ZX)     */
  27. /*                                                              */
  28. /*      - nntp create <newsgroup >  ==> create new newsgroup    */
  29. /*  - nntp config auto <on|off> ==> server will create          */
  30. /*                              automaticly new newsgroup       */
  31. /*                                                              */
  32. /****************************************************************/
  33. #define NNTPENH
  34.  
  35.  
  36. /****************************************************************/
  37. /*                                                              */
  38. /*         Compiler option for posting allowed (DG1ZX)          */
  39. /*                                                              */
  40. /****************************************************************/
  41. #define POST_ENBL
  42.  
  43.  
  44. /************************************************************************/
  45. /*                                                                      */
  46. /*   Compiler option for XHDR command (DG1ZX)                           */
  47. /*                                                                      */
  48. /*   syntax: XHDR header [articlerange]                                 */
  49. /*                                                                      */
  50. /*   header is a case-insensitive header field, minus any colons.       */
  51. /*   articlerange is one of:                                            */
  52. /*   - an article number                                                */
  53. /*   - an article number followed by a dash to indicate all following   */
  54. /*   - an article number followed by a dash followed by another article */
  55. /*     number                                                           */
  56. /*                                                                      */
  57. /*   e.g.,                                                              */
  58. /*                                                                      */
  59. /*   XHDR subject                 retrieve subject of current article   */
  60. /*   XHDR subject 5589-6325       retrieve subject of arts 5589 to 6325 */
  61. /*   XHDR subject 5589-           retrieve subject of arts 5589 and up  */
  62. /*   XHDR subject 5589            retrieve subject of art 5589 only     */
  63. /*                                                                      */
  64. /*   This command is an extension and not included in RFC 977.          */
  65. /************************************************************************/
  66. #define XHEADER
  67.  
  68. #define LineLen 512
  69.  
  70. struct article {
  71.     char *group;
  72.     char *id;
  73.     char *path;
  74.     unsigned number;
  75.     unsigned tmpu;
  76.     struct article *next;
  77. };
  78. #define NULLARTICLE (struct article *)0
  79.  
  80. struct post {
  81.     char *host;
  82.     char *user;
  83.     char *reply;
  84.     char *sig;
  85.     char *organ;
  86.     char *fullname;
  87. };
  88. #define NULLPOST (struct post *)0
  89.  
  90. struct head {
  91.     char *from;
  92.     char *reply_to;
  93.     char *subject;
  94.     char *id;
  95. };
  96. #define NULLHEAD (struct head *)0
  97.  
  98. struct g_list {
  99.     char *str;
  100.     struct g_list *next;
  101. };
  102. #define NULLG (struct g_list *)0
  103.  
  104. struct nntpserv {
  105.     int s;
  106.     unsigned  first;
  107.     unsigned  last;
  108.     unsigned  pointer;
  109.     unsigned  hold_i;
  110.  
  111.     char *buf;
  112.     char *newnews;
  113.     char *path;
  114.     char *id;
  115.  
  116.     int states;
  117. #define USER    0
  118. #define N_SLAVE    1
  119. #define N_DEBUG    2
  120. #define CLOSED    4
  121.     int32 unixtime;
  122.     int32 ftime;
  123.     struct date *datest;
  124.     struct time *timest;
  125.  
  126.     struct article *ap;
  127. };
  128.  
  129. extern char NEol[];
  130.  
  131. int    nntp1     __ARGS((int argc, char *argv[], void *p));
  132. int nntp0     __ARGS((int argc, char *argv[], void *p));
  133. int donntp     __ARGS((int argc, char *argv[], void *p));
  134. int nnGpost __ARGS((FILE *data,char *from,struct list *le));
  135.  
  136. /* in nntpcli.c */
  137. extern char noart[], artmsg[], retrieve[], badsyntax[];
  138. extern int LzwActive;
  139. extern int16 Nntpquiet;
  140. extern struct post Post;
  141. extern unsigned short Nntpmaxcli;
  142. #ifdef NNTPENH
  143. extern int fullauto;
  144. #endif
  145. #ifdef POST_ENBL
  146. extern int postingok;
  147. #endif
  148.  
  149. /* in nntpserv.c */
  150. void nntpserv __ARGS((int s,void *unused,void *p));
  151.  
  152. /* in nntpsubr.c */
  153. extern int Filecheck;
  154. int art_ret __ARGS((struct nntpserv *mp,int flag));
  155. int doarticle __ARGS((struct nntpserv *mp,int flag,char *hname));
  156. int check_system __ARGS((void));
  157. int get_id __ARGS((struct nntpserv *mp));
  158. int get_path __ARGS((struct nntpserv *mp));
  159. FILE *open_message __ARGS((struct nntpserv *mp));
  160. int recv_file __ARGS((FILE *fp,int s));
  161. int check_article __ARGS((char *id));
  162. int xfer_article2 __ARGS((FILE *fp,struct nntpserv *mp));
  163. int check_blank __ARGS((char *bp));
  164. int get_path2 __ARGS((struct article *ap));
  165. int32 make_nntime __ARGS((struct date *d,struct time *t,char *str));
  166. int newnews __ARGS((struct nntpserv *mp,FILE *f));
  167. int garbled __ARGS((FILE *f));
  168.  
  169. #ifdef NNTPENH
  170. int make_path __ARGS((char *group,int w));
  171. #endif
  172.  
  173. #endif /* _NNTP_H */
  174.